public class Test {
    public static int lastWordLengh(String [] s){
        String str1 = s[s.length - 1];
        int count = 0;
        for (int i = 0; i < str1.length(); i++) {
            count++;
        }
        return count;
    }

    public static void main(String[] args) {
        String [] str = new String[3];
        str[0] = "hello";
        str[1] = "world";
        str[2] = "yyxzz";

        System.out.println(lastWordLengh(str));
    }

    public static int firstUniqChar(String s){
        if(s == null){
            return 0;
        }
        int [] count = new int[26];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            count[ch - 'a']++;
        }
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if(count[ch - 'a'] == 1){
                return i;
            }
        }
        return -1;
    }

    public static void main1(String[] args) {
        String str = new String("ddabcc");
        System.out.println(firstUniqChar(str));
    }

}
